\(\int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx\) [1230]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 29, antiderivative size = 109 \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {\csc (c+d x)}{a^2 d}-\frac {2 b \log (\sin (c+d x))}{a^3 d}-\frac {2 \left (a^4-b^4\right ) \log (a+b \sin (c+d x))}{a^3 b^3 d}+\frac {\sin (c+d x)}{b^2 d}-\frac {\left (a^2-b^2\right )^2}{a^2 b^3 d (a+b \sin (c+d x))} \]

[Out]

-csc(d*x+c)/a^2/d-2*b*ln(sin(d*x+c))/a^3/d-2*(a^4-b^4)*ln(a+b*sin(d*x+c))/a^3/b^3/d+sin(d*x+c)/b^2/d-(a^2-b^2)
^2/a^2/b^3/d/(a+b*sin(d*x+c))

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {2916, 12, 908} \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {2 b \log (\sin (c+d x))}{a^3 d}-\frac {\left (a^2-b^2\right )^2}{a^2 b^3 d (a+b \sin (c+d x))}-\frac {\csc (c+d x)}{a^2 d}-\frac {2 \left (a^4-b^4\right ) \log (a+b \sin (c+d x))}{a^3 b^3 d}+\frac {\sin (c+d x)}{b^2 d} \]

[In]

Int[(Cos[c + d*x]^3*Cot[c + d*x]^2)/(a + b*Sin[c + d*x])^2,x]

[Out]

-(Csc[c + d*x]/(a^2*d)) - (2*b*Log[Sin[c + d*x]])/(a^3*d) - (2*(a^4 - b^4)*Log[a + b*Sin[c + d*x]])/(a^3*b^3*d
) + Sin[c + d*x]/(b^2*d) - (a^2 - b^2)^2/(a^2*b^3*d*(a + b*Sin[c + d*x]))

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 908

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2916

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d/b)*x)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {b^2 \left (b^2-x^2\right )^2}{x^2 (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^5 d} \\ & = \frac {\text {Subst}\left (\int \frac {\left (b^2-x^2\right )^2}{x^2 (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{b^3 d} \\ & = \frac {\text {Subst}\left (\int \left (1+\frac {b^4}{a^2 x^2}-\frac {2 b^4}{a^3 x}+\frac {\left (a^2-b^2\right )^2}{a^2 (a+x)^2}-\frac {2 \left (a^4-b^4\right )}{a^3 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{b^3 d} \\ & = -\frac {\csc (c+d x)}{a^2 d}-\frac {2 b \log (\sin (c+d x))}{a^3 d}-\frac {2 \left (a^4-b^4\right ) \log (a+b \sin (c+d x))}{a^3 b^3 d}+\frac {\sin (c+d x)}{b^2 d}-\frac {\left (a^2-b^2\right )^2}{a^2 b^3 d (a+b \sin (c+d x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.43 (sec) , antiderivative size = 95, normalized size of antiderivative = 0.87 \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {\frac {\csc (c+d x)}{a^2}+\frac {2 b \log (\sin (c+d x))}{a^3}+2 \left (\frac {a}{b^3}-\frac {b}{a^3}\right ) \log (a+b \sin (c+d x))-\frac {\sin (c+d x)}{b^2}+\frac {\left (a^2-b^2\right )^2}{a^2 b^3 (a+b \sin (c+d x))}}{d} \]

[In]

Integrate[(Cos[c + d*x]^3*Cot[c + d*x]^2)/(a + b*Sin[c + d*x])^2,x]

[Out]

-((Csc[c + d*x]/a^2 + (2*b*Log[Sin[c + d*x]])/a^3 + 2*(a/b^3 - b/a^3)*Log[a + b*Sin[c + d*x]] - Sin[c + d*x]/b
^2 + (a^2 - b^2)^2/(a^2*b^3*(a + b*Sin[c + d*x])))/d)

Maple [A] (verified)

Time = 0.93 (sec) , antiderivative size = 106, normalized size of antiderivative = 0.97

method result size
derivativedivides \(\frac {\frac {\sin \left (d x +c \right )}{b^{2}}-\frac {1}{a^{2} \sin \left (d x +c \right )}-\frac {2 b \ln \left (\sin \left (d x +c \right )\right )}{a^{3}}+\frac {\left (-2 a^{4}+2 b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{3} b^{3}}-\frac {a^{4}-2 a^{2} b^{2}+b^{4}}{b^{3} a^{2} \left (a +b \sin \left (d x +c \right )\right )}}{d}\) \(106\)
default \(\frac {\frac {\sin \left (d x +c \right )}{b^{2}}-\frac {1}{a^{2} \sin \left (d x +c \right )}-\frac {2 b \ln \left (\sin \left (d x +c \right )\right )}{a^{3}}+\frac {\left (-2 a^{4}+2 b^{4}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{3} b^{3}}-\frac {a^{4}-2 a^{2} b^{2}+b^{4}}{b^{3} a^{2} \left (a +b \sin \left (d x +c \right )\right )}}{d}\) \(106\)
parallelrisch \(\frac {2 \left (\left (-a^{4} b +b^{5}\right ) \sin \left (d x +c \right )-a^{5}+a \,b^{4}\right ) \ln \left (2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )\right )+2 \left (a^{4} b \sin \left (d x +c \right )+a^{5}\right ) \ln \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \left (\left (-\sin \left (d x +c \right ) b^{4}-a \,b^{3}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {a^{2} b^{2} \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (-2+\cos \left (2 d x +2 c \right )\right ) \csc \left (\frac {d x}{2}+\frac {c}{2}\right )}{4}-\frac {a^{3} b \cos \left (2 d x +2 c \right )}{4}+\left (a^{4}+b^{4}\right ) \sin \left (d x +c \right )+\frac {a^{3} b}{4}\right )}{a^{3} b^{3} d \left (a +b \sin \left (d x +c \right )\right )}\) \(213\)
risch \(\frac {2 i x a}{b^{3}}-\frac {i {\mathrm e}^{i \left (d x +c \right )}}{2 b^{2} d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 b^{2} d}+\frac {4 i a c}{b^{3} d}-\frac {2 \left (a^{4} {\mathrm e}^{3 i \left (d x +c \right )}-2 a^{2} b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+2 b^{4} {\mathrm e}^{3 i \left (d x +c \right )}-a^{4} {\mathrm e}^{i \left (d x +c \right )}+2 a^{2} b^{2} {\mathrm e}^{i \left (d x +c \right )}-2 b^{4} {\mathrm e}^{i \left (d x +c \right )}+2 i a \,b^{3} {\mathrm e}^{2 i \left (d x +c \right )}\right )}{a^{2} d \,b^{3} \left (2 a \,{\mathrm e}^{3 i \left (d x +c \right )}-i b \,{\mathrm e}^{4 i \left (d x +c \right )}-2 a \,{\mathrm e}^{i \left (d x +c \right )}+2 i b \,{\mathrm e}^{2 i \left (d x +c \right )}-i b \right )}-\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{3} d}-\frac {2 a \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{b^{3} d}+\frac {2 b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}\right )}{a^{3} d}\) \(326\)
norman \(\frac {\frac {\left (12 a^{4}-17 a^{2} b^{2}+12 b^{4}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{3} b^{2} d}+\frac {\left (12 a^{4}-17 a^{2} b^{2}+12 b^{4}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{3} b^{2} d}-\frac {1}{2 a d}-\frac {\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}+\frac {4 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b d}+\frac {4 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b d}+\frac {8 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b d}+\frac {\left (8 a^{4}-13 a^{2} b^{2}+8 b^{4}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{3} b^{2} d}+\frac {\left (8 a^{4}-13 a^{2} b^{2}+8 b^{4}\right ) \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a^{3} b^{2} d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}+\frac {2 a \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3} d}-\frac {2 b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a^{3} d}-\frac {2 \left (a^{4}-b^{4}\right ) \ln \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a +2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a \right )}{a^{3} b^{3} d}\) \(395\)

[In]

int(cos(d*x+c)^5*csc(d*x+c)^2/(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(sin(d*x+c)/b^2-1/a^2/sin(d*x+c)-2/a^3*b*ln(sin(d*x+c))+(-2*a^4+2*b^4)/a^3/b^3*ln(a+b*sin(d*x+c))-1/b^3*(a
^4-2*a^2*b^2+b^4)/a^2/(a+b*sin(d*x+c)))

Fricas [A] (verification not implemented)

none

Time = 0.42 (sec) , antiderivative size = 214, normalized size of antiderivative = 1.96 \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {a^{4} b \cos \left (d x + c\right )^{2} - a^{4} b + a^{2} b^{3} + 2 \, {\left (a^{4} b - b^{5} - {\left (a^{4} b - b^{5}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{5} - a b^{4}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) - 2 \, {\left (b^{5} \cos \left (d x + c\right )^{2} - a b^{4} \sin \left (d x + c\right ) - b^{5}\right )} \log \left (\frac {1}{2} \, \sin \left (d x + c\right )\right ) + {\left (a^{3} b^{2} \cos \left (d x + c\right )^{2} + a^{5} - 3 \, a^{3} b^{2} + 2 \, a b^{4}\right )} \sin \left (d x + c\right )}{a^{3} b^{4} d \cos \left (d x + c\right )^{2} - a^{4} b^{3} d \sin \left (d x + c\right ) - a^{3} b^{4} d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^2/(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

(a^4*b*cos(d*x + c)^2 - a^4*b + a^2*b^3 + 2*(a^4*b - b^5 - (a^4*b - b^5)*cos(d*x + c)^2 + (a^5 - a*b^4)*sin(d*
x + c))*log(b*sin(d*x + c) + a) - 2*(b^5*cos(d*x + c)^2 - a*b^4*sin(d*x + c) - b^5)*log(1/2*sin(d*x + c)) + (a
^3*b^2*cos(d*x + c)^2 + a^5 - 3*a^3*b^2 + 2*a*b^4)*sin(d*x + c))/(a^3*b^4*d*cos(d*x + c)^2 - a^4*b^3*d*sin(d*x
 + c) - a^3*b^4*d)

Sympy [F(-1)]

Timed out. \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\text {Timed out} \]

[In]

integrate(cos(d*x+c)**5*csc(d*x+c)**2/(a+b*sin(d*x+c))**2,x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.10 \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {\frac {a b^{3} + {\left (a^{4} - 2 \, a^{2} b^{2} + 2 \, b^{4}\right )} \sin \left (d x + c\right )}{a^{2} b^{4} \sin \left (d x + c\right )^{2} + a^{3} b^{3} \sin \left (d x + c\right )} + \frac {2 \, b \log \left (\sin \left (d x + c\right )\right )}{a^{3}} - \frac {\sin \left (d x + c\right )}{b^{2}} + \frac {2 \, {\left (a^{4} - b^{4}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{3} b^{3}}}{d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^2/(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-((a*b^3 + (a^4 - 2*a^2*b^2 + 2*b^4)*sin(d*x + c))/(a^2*b^4*sin(d*x + c)^2 + a^3*b^3*sin(d*x + c)) + 2*b*log(s
in(d*x + c))/a^3 - sin(d*x + c)/b^2 + 2*(a^4 - b^4)*log(b*sin(d*x + c) + a)/(a^3*b^3))/d

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.20 \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=-\frac {\frac {2 \, b \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{3}} - \frac {\sin \left (d x + c\right )}{b^{2}} - \frac {a^{3} \sin \left (d x + c\right )^{2} + 2 \, a^{2} b \sin \left (d x + c\right ) - 2 \, b^{3} \sin \left (d x + c\right ) - a b^{2}}{{\left (b \sin \left (d x + c\right )^{2} + a \sin \left (d x + c\right )\right )} a^{2} b^{2}} + \frac {2 \, {\left (a^{4} - b^{4}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{3} b^{3}}}{d} \]

[In]

integrate(cos(d*x+c)^5*csc(d*x+c)^2/(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-(2*b*log(abs(sin(d*x + c)))/a^3 - sin(d*x + c)/b^2 - (a^3*sin(d*x + c)^2 + 2*a^2*b*sin(d*x + c) - 2*b^3*sin(d
*x + c) - a*b^2)/((b*sin(d*x + c)^2 + a*sin(d*x + c))*a^2*b^2) + 2*(a^4 - b^4)*log(abs(b*sin(d*x + c) + a))/(a
^3*b^3))/d

Mupad [B] (verification not implemented)

Time = 13.43 (sec) , antiderivative size = 313, normalized size of antiderivative = 2.87 \[ \int \frac {\cos ^3(c+d x) \cot ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx=\frac {\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (4\,a^2-b^2\right )}{b}-2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-a+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (4\,a^4-5\,a^2\,b^2+2\,b^4\right )}{a\,b^2}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (8\,a^4-9\,a^2\,b^2+4\,b^4\right )}{a\,b^2}}{d\,\left (2\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+4\,b\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,b\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a^2\,d}+\frac {2\,a\,\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{b^3\,d}-\frac {2\,b\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a^3\,d}-\frac {2\,\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (a^4-b^4\right )}{a^3\,b^3\,d} \]

[In]

int(cos(c + d*x)^5/(sin(c + d*x)^2*(a + b*sin(c + d*x))^2),x)

[Out]

((2*tan(c/2 + (d*x)/2)^3*(4*a^2 - b^2))/b - 2*b*tan(c/2 + (d*x)/2) - a + (2*tan(c/2 + (d*x)/2)^2*(4*a^4 + 2*b^
4 - 5*a^2*b^2))/(a*b^2) + (tan(c/2 + (d*x)/2)^4*(8*a^4 + 4*b^4 - 9*a^2*b^2))/(a*b^2))/(d*(4*a^3*tan(c/2 + (d*x
)/2)^3 + 2*a^3*tan(c/2 + (d*x)/2)^5 + 2*a^3*tan(c/2 + (d*x)/2) + 4*a^2*b*tan(c/2 + (d*x)/2)^2 + 4*a^2*b*tan(c/
2 + (d*x)/2)^4)) - tan(c/2 + (d*x)/2)/(2*a^2*d) + (2*a*log(tan(c/2 + (d*x)/2)^2 + 1))/(b^3*d) - (2*b*log(tan(c
/2 + (d*x)/2)))/(a^3*d) - (2*log(a + 2*b*tan(c/2 + (d*x)/2) + a*tan(c/2 + (d*x)/2)^2)*(a^4 - b^4))/(a^3*b^3*d)